package edu.clemson.wcbeck.cft;

import android.os.Parcel;
import android.os.Parcelable;

public class Team implements Parcelable{

	private int id;
	private int conf_id;
	private String name;
	private String fullName;
	private int favorite;
	private static final String[] CONFS = {"ACC", "Big 12", "Big East", "Big Ten", 
		"C-USA", "I-A Indeps", "MAC", "MW", "Pac-12", "SEC", "Sun Belt", "WAC"};
	
	public Team() {}
	
	public Team(Parcel in){
		readFromParcel(in);
	}
	
	public int getId(){
		return id;
	}
	
	public void setId(int id){
		this.id = id;
	}
	
	public int getConfId(){
		return conf_id;
	}
	
	public void setConfId(int conf_id){
		this.conf_id = conf_id;
	}
	
	public String getName(){
		return name;
	}
	
	public void setName(String name){
		this.name = name;
	}
	
	public String getFullName(){
		return fullName;
	}
	
	public void setFullName(String fullName){
		this.fullName = fullName;
	}
	
	public int isFavorite(){
		return favorite;
	}
	
	public void setFavorite(int favorite){
		this.favorite = favorite;
	}
	
	private void readFromParcel(Parcel in) {
		 
		id = in.readInt();
		conf_id = in.readInt();
		name = in.readString();
		fullName = in.readString();
		favorite = in.readInt();
	}
	
	@Override
	public String toString(){
		return CONFS[conf_id-1] + " - " + name;
	}

	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(id);
		dest.writeInt(conf_id);
		dest.writeString(name);
		dest.writeString(fullName);
		dest.writeInt(favorite);
	}
	
	@SuppressWarnings("rawtypes")
	public static final Parcelable.Creator CREATOR =
	new Parcelable.Creator() {
		public Team createFromParcel(Parcel in) {
			return new Team(in);
		}

		public Team[] newArray(int size) {
			return new Team[size];
		}
	};
	
}
